package com.example.bluetoothdemo;

import android.app.*;
import android.content.Intent;
import android.graphics.Color;
import android.os.Binder;
import android.os.Build;
import android.os.IBinder;
import android.util.Log;
import android.view.View;
import android.widget.RemoteViews;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;

import static android.content.ContentValues.TAG;

public class NotificationService extends Service {

    private String CHANNEL_ID = "channel_01";
    private NotificationManager notificationManager;
    private final int NOTIFICATION_ID = 200;



    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        Log.d(TAG, "onStartCommand: notification");
//        buildNotification();
        return START_STICKY;
    }

//    private void buildNotification() {
//        Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)
//                .setSmallIcon(R.drawable.ic_launcher_background)
//                .setOngoing(true)
//                .setContentTitle("title")
//                .setContentText("artist")
//                .setSound(null)
//                .setShowWhen(false)
//                .setColorized(true)
//                .setColor(Color.BLACK)
//                .setVisibility(NotificationCompat.VISIBILITY_PUBLIC)
//                .setStyle(
//                        new androidx.media.app.NotificationCompat.MediaStyle()
//                                .setShowActionsInCompactView(0, 1, 2)
//                )
//                .setPriority(NotificationCompat.PRIORITY_HIGH)
//                .build();
//
//        notificationManager = (NotificationManager) this.getSystemService(NOTIFICATION_SERVICE);
//        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
//            NotificationChannel channel = new NotificationChannel(CHANNEL_ID, "channel_name", NotificationManager.IMPORTANCE_DEFAULT);
//            notificationManager.createNotificationChannel(channel);
//        }
//        notificationManager.notify(NOTIFICATION_ID, notification);
//        Log.d(TAG, "buildNotification: startForeground");
//        startForeground(NOTIFICATION_ID, notification);
//    }
}
